#pragma once

#include "Common/Item/Item.h"


class Creature;
struct ItemItemCfgInfo;
struct IItemUse
{
	virtual ~IItemUse(){};
	virtual int8_t funcType() = 0;
	/*
	pItemCfg :物品配置
	nNum : 数量
	pCreatrue ： 使用物品的生物指针
	UseItemArgProto ： 使用物品需要的参数
	*/
	virtual int32_t useItem(const ItemItemCfgInfo *pItemCfg, CItemBase *item, int32_t nNum, Creature *pCreatrue, UseItemArgProto &arg) = 0;
};

class CItemUse : public IItemUse
{
public:
	CItemUse();
	virtual ~CItemUse();
	//////////////////////////////////////////////////////////////////////////
	virtual int32_t useItem(const ItemItemCfgInfo *pItemCfg, CItemBase *item, int32_t nNum, Creature *pCreatrue, UseItemArgProto &arg);
protected:
	virtual int32_t onUse(const ItemItemCfgInfo *pItemCfg, CItemBase *item, int32_t nNum, const VEC_INT32 *pVecParam, Creature *pCreatrue, const VEC_INT32 *pVecOtherParam, UseItemArgProto &arg, Creature *pTarget);
};


//0，无功能
class CItemUse_NoFunc : public CItemUse
{
public:
	CItemUse_NoFunc(){};
	virtual ~CItemUse_NoFunc(){};
	////////////////////////////// IItemUse ////////////////////////////////////////////
	virtual int8_t funcType() { return (int8_t)EItemFuncType::EItemFuncType_NoFunc; };
protected:
	virtual int32_t onUse(const ItemItemCfgInfo *pItemCfg, CItemBase *item, int32_t nNum, const VEC_INT32 *pVecParam, Creature *pCreatrue, const VEC_INT32 *pVecOtherParam, UseItemArgProto &arg, Creature *pTarget);
};


//1，使用修改属性、货币数值（血瓶、加属性上限的物品、金币袋、军功勋章）
class CItemUse_ModAttr : public CItemUse
{
public:
	CItemUse_ModAttr(){};
	virtual ~CItemUse_ModAttr(){};
	////////////////////////////// IItemUse ////////////////////////////////////////////
	virtual int8_t funcType() { return (int8_t)EItemFuncType::EItemFuncType_ModifyAttr; };
protected:
	virtual int32_t onUse(const ItemItemCfgInfo *pItemCfg, CItemBase *item, int32_t nNum, const VEC_INT32 *pVecParam, Creature *pCreatrue, const VEC_INT32 *pVecOtherParam, UseItemArgProto &arg, Creature *pTarget);
};


//9，包物品（可以开出其他物品的物品）
class CItemUse_Box : public CItemUse
{
public:
	CItemUse_Box(){};
	virtual ~CItemUse_Box(){};
	////////////////////////////// IItemUse ////////////////////////////////////////////
	virtual int8_t funcType() { return (int8_t)EItemFuncType::EItemFuncType_Box; };
protected:
	virtual int32_t onUse(const ItemItemCfgInfo *pItemCfg, CItemBase *item, int32_t nNum, const VEC_INT32 *pVecParam, Creature *pCreatrue, const VEC_INT32 *pVecOtherParam, UseItemArgProto &arg, Creature *pTarget);
};


//11，关联技能的物品（使用触发BUFF、触发角色效果、触发替换模型）
class CItemUse_RelateSkill : public CItemUse
{
public:
	CItemUse_RelateSkill(){};
	~CItemUse_RelateSkill(){};
	////////////////////////////// IItemUse ////////////////////////////////////////////
	virtual int8_t funcType() { return (int8_t)EItemFuncType::EItemFuncType_RelateSkill; };
protected:
	virtual int32_t onUse(const ItemItemCfgInfo *pItemCfg, CItemBase *item, int32_t nNum, const VEC_INT32 *pVecParam, Creature *pCreatrue, const VEC_INT32 *pVecOtherParam, UseItemArgProto &arg, Creature *pTarget);
};

//12，使用触发任务（该类任务物品使用，触发弹出指定任务的接取面板）
class CItemUse_TriggerTask : public CItemUse
{
public:
	CItemUse_TriggerTask(){};
	virtual ~CItemUse_TriggerTask(){};
	////////////////////////////// IItemUse ////////////////////////////////////////////
	virtual int8_t funcType() { return (int8_t)EItemFuncType::EItemFuncType_TriggerTask; };
protected:
	virtual int32_t onUse(const ItemItemCfgInfo *pItemCfg, CItemBase *item, int32_t nNum, const VEC_INT32 *pVecParam, Creature *pCreatrue, const VEC_INT32 *pVecOtherParam, UseItemArgProto &arg, Creature *pTarget);
};


//14，可使用的任务物品
class CItemUse_TaskUse : public CItemUse
{
public:
	CItemUse_TaskUse(){};
	virtual ~CItemUse_TaskUse(){};
	////////////////////////////// IItemUse ////////////////////////////////////////////
	virtual int8_t funcType() { return (int8_t)EItemFuncType::EItemFuncType_TaskUse; };
protected:
	virtual int32_t onUse(const ItemItemCfgInfo *pItemCfg, CItemBase *item, int32_t nNum, const VEC_INT32 *pVecParam, Creature *pCreatrue, const VEC_INT32 *pVecOtherParam, UseItemArgProto &arg, Creature *pTarget);
};

//15，扩充背包（装备、日常、材料各增加25格）
class CItemUse_ExpandPackage : public CItemUse
{
public:
	CItemUse_ExpandPackage(){};
	virtual ~CItemUse_ExpandPackage(){};
	////////////////////////////// IItemUse ////////////////////////////////////////////
	virtual int8_t funcType() { return (int8_t)EItemFuncType::EItemFuncType_ExpandPackage; };
protected:
	virtual int32_t onUse(const ItemItemCfgInfo *pItemCfg, CItemBase *item, int32_t nNum, const VEC_INT32 *pVecParam, Creature *pCreatrue, const VEC_INT32 *pVecOtherParam, UseItemArgProto &arg, Creature *pTarget);
};

//20，使用星魂传送
class CItemUse_StarSoul : public CItemUse
{
public:
	CItemUse_StarSoul(){};
	virtual ~CItemUse_StarSoul(){};
	////////////////////////////// IItemUse ////////////////////////////////////////////
	virtual int8_t funcType() { return (int8_t)EItemFuncType::EItemFuncType_StarSoul; };
protected:
	virtual int32_t onUse(const ItemItemCfgInfo *pItemCfg, CItemBase *item, int32_t nNum, const VEC_INT32 *pVecParam, Creature *pCreatrue, const VEC_INT32 *pVecOtherParam, UseItemArgProto &arg, Creature *pTarget);
};
 
//21，使用时装
class CItemUse_Fashion : public CItemUse
{
public:
	CItemUse_Fashion(){};
	virtual ~CItemUse_Fashion(){};
	////////////////////////////// IItemUse ////////////////////////////////////////////
	virtual int8_t funcType() { return (int8_t)EItemFuncType::EItemFuncType_Fashion; };
protected:
	virtual int32_t onUse(const ItemItemCfgInfo *pItemCfg, CItemBase *item, int32_t nNum, const VEC_INT32 *pVecParam, Creature *pCreatrue, const VEC_INT32 *pVecOtherParam, UseItemArgProto &arg, Creature *pTarget);
};

//23，使用清心石
class CItemUse_ClearAnger : public CItemUse
{
public:
	CItemUse_ClearAnger(){};
	virtual ~CItemUse_ClearAnger(){};
	////////////////////////////// IItemUse ////////////////////////////////////////////
	virtual int8_t funcType() { return (int8_t)EItemFuncType::EItemFuncType_ClearAnger; };
protected:
	virtual int32_t onUse(const ItemItemCfgInfo *pItemCfg, CItemBase *item, int32_t nNum, const VEC_INT32 *pVecParam, Creature *pCreatrue, const VEC_INT32 *pVecOtherParam, UseItemArgProto &arg, Creature *pTarget);
};



//25，血包类物品
class CItemUse_HpMpBox : public CItemUse
{
public:
	CItemUse_HpMpBox(){};
	virtual ~CItemUse_HpMpBox(){};
	////////////////////////////// IItemUse ////////////////////////////////////////////
	virtual int8_t funcType() { return (int8_t)EItemFuncType::EItemFuncType_HpMpBox; };
protected:
	virtual int32_t onUse(const ItemItemCfgInfo *pItemCfg, CItemBase *item, int32_t nNum, const VEC_INT32 *pVecParam, Creature *pCreatrue, const VEC_INT32 *pVecOtherParam, UseItemArgProto &arg, Creature *pTarget);
};


//26，坐骑卡
class CItemUse_HorseCard : public CItemUse
{
public:
	CItemUse_HorseCard() {};
	virtual ~CItemUse_HorseCard(){};
	////////////////////////////// IItemUse ////////////////////////////////////////////
	virtual int8_t funcType() { return (int8_t)EItemFuncType::EItemFuncType_HorseCard; };
protected:
	virtual int32_t onUse(const ItemItemCfgInfo *pItemCfg, CItemBase *item, int32_t nNum, const VEC_INT32 *pVecParam, Creature *pCreatrue, const VEC_INT32 *pVecOtherParam, UseItemArgProto &arg, Creature *pTarget);
};


//30，内挂卡
class CItemUse_HangCard : public CItemUse
{
public:
	CItemUse_HangCard() {};
	virtual ~CItemUse_HangCard(){};
	////////////////////////////// IItemUse ////////////////////////////////////////////
	virtual int8_t funcType() { return (int8_t)EItemFuncType::EItemFuncType_HangCard; };
protected:
	virtual int32_t onUse(const ItemItemCfgInfo *pItemCfg, CItemBase *item, int32_t nNum, const VEC_INT32 *pVecParam, Creature *pCreatrue, const VEC_INT32 *pVecOtherParam, UseItemArgProto &arg, Creature *pTarget);
};


//31，扩充仓库
class CItemUse_ExpandStorage : public CItemUse
{
public:
	CItemUse_ExpandStorage(){};
	virtual ~CItemUse_ExpandStorage(){};
	////////////////////////////// IItemUse ////////////////////////////////////////////
	virtual int8_t funcType() { return (int8_t)EItemFuncType::EItemFuncType_ExpandStorage; };
protected:
	virtual int32_t onUse(const ItemItemCfgInfo *pItemCfg, CItemBase *item, int32_t nNum, const VEC_INT32 *pVecParam, Creature *pCreatrue, const VEC_INT32 *pVecOtherParam, UseItemArgProto &arg, Creature *pTarget);
};